<ul class="nav nav-tabs">
<?php
if(!isset($categories))
{
	$categories = array();
}
if(!empty($categories))
{
	$categoryClass = "category_link";
	if($categoryId=="")
	{
		$categoryClass = "active";
	}
	//echo $html->link(__("All ".$dealType."s"),array("controller"=>"deals","action"=>"index",$dealType),array("class"=>$categoryClass));
	echo '<li class="'.$categoryClass.'">'.$html->link(__("All deals"),array("plugin"=>"deals","controller"=>"deals","action"=>"index"),array("class"=>$categoryClass)).'<i class="fa fa-caret-down"></i></li>';
	
	foreach ($categories as $catId => $category)
	{
		if($catId != 13){
			$categoryClass = "category_link";
			
			//@todo remove the line below when other solution is added - which was initially added to add gap between category links
			//echo "&nbsp;&nbsp;&nbsp;&nbsp;";
	
			//$category = substr($category, strpos($category, ". ")+2);
			$category = ucwords(strtolower($category));		
			if($catId == $categoryId)
			{
				$categoryClass = "active";
			}
			//echo $html->link(__($category),array("plugin"=>"deals","controller"=>"deals","action"=>"index",$dealType,$catId),array("class"=>$categoryClass));
			echo '<li class="'.$categoryClass.'">'.$html->link(__($category),array("plugin"=>"deals","controller"=>"deals","action"=>"index",$catId),array("class"=>$categoryClass)).'<i class="fa fa-caret-down"></i></li>';
		}
	}
}
?>
</ul>